<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<link rel="stylesheet" href="./animate.css">
	<script src="./vue.js"></script>
	<script src="./velocity.js"></script>
</head>
<body>
	<div id="root">
		<transition 
			name="fade"
			@before-enter="handleBeforeEnter"
			@enter="handleEnter"
			@after-enter="handleAfterEnter"			
		>
			<div v-if="show">hello world</div>
		</transition>
		<button @click="handleClick">切换</button>
	</div>
	
	<script>
		var vm = new Vue({
			el: '#root',
			data: {	
				show: true
			},
			methods: {
				handleClick () {
					this.show = !this.show;
				},
				handleBeforeEnter (el) {
					el.style.opacity = 0;
				},
				handleEnter (el, done) {
					Velocity(el, {opacity: 1}, {duartion: 1000, complete: done})
				},
				handleAfterEnter (el) {
					
				}
			}
		})
	</script>
</body>
</html>